package com.mccrea.pattern.state;

/**
 * @Classname LowState
 * @Description 不及格
 * @Date 2021/5/24 0024 15:04
 * @Created by Mccrea_Gao
 */
public class LowState extends AbstractState {

    public LowState(ScoreContext scoreContext1) {
        scoreContext = scoreContext1;
        stateName = "不及格";
        score = 0;
    }

    public LowState(AbstractState state) {
        scoreContext = state.scoreContext;
        stateName = "不及格";
        score = state.score;
    }

    @Override
    public void checkState() {
        if (score > 90) {
            scoreContext.setState(new HighState(this));
        } else if (score >= 60) {
            scoreContext.setState(new MiddleState(this));
        }
    }
}
